import request from '../utils/request'
export function getDepartments() {
  return request({
    url: '/company/department'
  })
}
// 添加部门
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 获取部门详情
export function getDepartmentDetailById(id) {
  return request({
    url: '/company/department/' + id,
    method: 'GET'

  })
}
// 更新部门数据
export function updateDepartments(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}
// 删除部门
export function delDepartment(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
